<template>
    <div class="dialog">
        <el-dialog
            title="查看问题"
            :visible.sync="ifDialog"
        >
            <el-form ref="form" :model="form" label-width="100px">

                <el-form-item
                    label="所属类别"
                >
                     <el-select v-model="form.kindName" style="float: left">
                        <el-option
                        v-for="item in form.allKind"
                        :key="item"
                        :label="item"
                        :value="item">
                        </el-option>
                    </el-select>
                </el-form-item>

                <el-form-item
                    label="支付价格"
                >
                    <el-input v-model="form.payPrice"></el-input>
                </el-form-item>

                <el-form-item
                    label="提问时间"
                >
                    <el-input v-model="form.whenAsk"></el-input>
                </el-form-item>

                <el-form-item
                    label="问题内容"
                >
                    <el-input v-model="form.questionContent" type="textarea"  :autosize="true"></el-input>
                </el-form-item>

                <el-form-item
                    label="是否匿名"
                >   
                  
                    <el-select v-model="form.isAnonymous" style="float: left">
                        <el-option
                        v-for="item in booleanChoose"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>

                </el-form-item>

                <el-form-item
                    label="是否已解决"
                >   
                  
                    <el-select v-model="form.isSolved" style="float: left">
                        <el-option
                        v-for="item in booleanChoose"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>

                </el-form-item>

                <el-form-item
                    label="显示在首页"
                >   
                  
                    <el-select v-model="form.isShowPage" style="float: left">
                        <el-option
                        v-for="item in booleanChoose"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>

                </el-form-item>


                <el-form-item
                    label="是否关闭"
                >   
                  
                    <el-select v-model="form.isClose" style="float: left">
                        <el-option
                        v-for="item in booleanChoose"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>

                </el-form-item>

                <el-form-item
                    label="是否公开"
                >   
                  
                    <el-select v-model="form.isPublic" style="float: left">
                        <el-option
                        v-for="item in booleanChoose"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        </el-option>
                    </el-select>

                </el-form-item>

                <el-form-item>
                    <el-button type="primary" @click="confirm">确认</el-button>
                    <el-button @click="cancel">取消</el-button>
                </el-form-item>

            </el-form>
        </el-dialog>
    </div>
</template>

<script>
export default {
    name: 'DialogAdd',
    data () {
        return {
            ifDialog: false,
            form: {
                payPrice: 10,
                kindName: '增肌',
                allKind: ['增肌', '减脂'],
                isAnonymous: false
                
            },
            booleanChoose: [{
                value: true,
                label: '是'
            }, {
                value: false,
                label: '否'
            }]
        }
    },
    methods: {
        show() {
            this.ifDialog = true;
        },
        confirm() {
            this.ifDialog = false;
        },
        cancel() {
            this.ifDialog = false;
        }
    }
}
</script>

<style lang="stylus" scoped>
    .dialog
        width 100%
        
</style>


